<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.util.* ,user.*" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getLocalPort()+request.getContextPath()+"/";
%>
<html>
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
.tag{text-align: center;}
</style>
</head>
<body>
 <% List<User>listUser=new ArrayList<User>(); 
    User use1=new User("a",20);
    User use2=new User("b",21);
    User use3=new User("c",22);
    User use4=new User("d",23);
    User use5=new User("e",24);
    User use6=new User("f",25);
    User use7=new User("g",26);
    User use8=new User("h",27);
    User use9=new User("i",28);
    User use10=new User("j",29);
    listUser.add(use1);
    listUser.add(use2);
    listUser.add(use3);
    listUser.add(use4);
    listUser.add(use5);
    listUser.add(use6);
    listUser.add(use7);
    listUser.add(use8);
    listUser.add(use9);
    listUser.add(use10);
     %>

	<%
		List<User> list = new ArrayList<User>();
		request.setAttribute("list", listUser);
	%>

	<!--  表格显示数据 -->
	<table class="tag" border="1" width="70%">
		<tr>
			<td>用户名</td>
			<td>密码</td>
		</tr>
		<c:forEach var="bean" items="${list}">
			<tr>
				<td><c:out value=" ${bean.name}"></c:out></td>
				<td><c:out value=" ${bean.age}"></c:out></td>
			<tr />
		</c:forEach>
	</table>
</body>
</html>